package com.demo.common.util;



import java.util.ArrayList;
import java.util.List;


public class PageList {
    //总共的条数
    private Long total;
    //每一页显示的数据
    private List rows = new ArrayList();

    //每页显示的条数
    private Long pageSize = 10L;

    //当前页
    private Long currentPage;

    //总页数
    private Long totalPage;

    //首页
    private Long firstPage=1L;

    //尾页
    private Long endPage;

    public PageList(){}

    public PageList(Long currentPage,Long total,List rows){
        this.total = total;
        this.rows = rows;
        this.firstPage = 1L;
        this.endPage = total % pageSize == 0?total / pageSize: (total / pageSize) +1;
        this.totalPage = this.endPage;
        this.currentPage = currentPage;
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public List getRows() {
        return rows;
    }

    public void setRows(List rows) {
        this.rows = rows;
    }

    public Long getPageSize() {
        return pageSize;
    }

    public void setPageSize(Long pageSize) {
        this.pageSize = pageSize;
    }

    public Long getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(Long currentPage) {
        this.currentPage = currentPage;
    }

    public Long getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Long totalPage) {
        this.totalPage = totalPage;
    }

    public Long getFirstPage() {
        return firstPage;
    }

    public void setFirstPage(Long firstPage) {
        this.firstPage = firstPage;
    }

    public Long getEndPage() {
        return endPage;
    }

    public void setEndPage(Long endPage) {
        this.endPage = endPage;
    }
}
